// 一倍图
@mixin bg-image($url, $type) {
  background-image: url($url+'.'+$type);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
}

// 线性渐变
@mixin linear-gradient($deg, $start, $end) {
  background-image: -webkit-gradient(
    linear,
    0% 0%,
    100% 0%,
    from($start),
    to($end)
  );
  background-image: -webkit-linear-gradient($deg, $start 0%, $end 100%);
  background-image: -moz-linear-gradient($deg, $start 0%, $end 100%);
  background-image: -ms-linear-gradient($deg, $start 0%, $end 100%);
  background-image: -o-linear-gradient($deg, $start 0%, $end 100%);
  background-image: linear-gradient($deg, $start 0%, $end 100%);
}

// 高斯效果
@mixin blur($depth) {
  -webkit-filter: blur($depth + px);
  -moz-filter: blur($depth + px);
  -ms-filter: blur($depth + px);
  -o-filter: blur($depth + px);
  filter: blur($depth + px);
}

// X轴位移
@mixin translateX($len) {
  -webkit-transform: translateX($len);
  -moz-transform: translateX($len);
  -ms-transform: translateX($len);
  -o-transform: translateX($len);
  transform: translateX($len);
}

// Y轴位移
@mixin translateY($len) {
  -webkit-transform: translateY($len);
  -moz-transform: translateY($len);
  -ms-transform: translateY($len);
  -o-transform: translateY($len);
  transform: translateY($len);
}

// Z轴位移
@mixin translateZ($len) {
  -webkit-transform: translateZ($len);
  -moz-transform: translateZ($len);
  -ms-transform: translateZ($len);
  -o-transform: translateZ($len);
  transform: translateZ($len);
}

// 2d位移
@mixin translate2d($xLen, $yLen) {
  -webkit-transform: translateX($xLen) translateY($yLen);
  -moz-transform: translateX($xLen) translateY($yLen);
  -ms-transform: translateX($xLen) translateY($yLen);
  -o-transform: translateX($xLen) translateY($yLen);
  transform: translateX($xLen) translateY($yLen);
}

// 3d位移
@mixin translate3d($xLen, $yLen, $zLen) {
  -webkit-transform: translateX($xLen) translateY($yLen) translateZ($zLen);
  -moz-transform: translateX($xLen) translateY($yLen) translateZ($zLen);
  -ms-transform: translateX($xLen) translateY($yLen) translateZ($zLen);
  -o-transform: translateX($xLen) translateY($yLen) translateZ($zLen);
  transform: translateX($xLen) translateY($yLen) translateZ($zLen);
}
